﻿using UnityEngine;

public class LevelManager {
	// === Public =====================================================================================================
	public static LevelManager CreateInstance() {
		var instance = new LevelManager();
		return instance;
	}

	public void Create() {
		CreateParent();
		Managers.Field.Create(_parent);
		Managers.Grid.Create(_parent);
		Managers.Frame.Create(_parent);
		Managers.Stone.Create(_parent);
	}

	public void Destroy() {
		Managers.Field.Destroy();
		Managers.Grid.Destroy();
		Managers.Frame.Destroy();
		Managers.Stone.Destroy();
		Object.Destroy(_parent);
	}

	// === Private ====================================================================================================
	private GameObject _parent;

	private void CreateParent() {
		_parent = new GameObject("Level");
	}
}
